<template>
	<view class="container">
		<view class="phone-box">
			 <u--input placeholder="手机号" border="surround" prefixIcon="phone" v-model="user.cellphone"></u--input>  
		</view>
		<view class="pwd-box">
			 <u--input type="password"  placeholder="密码" border="surround" prefixIcon="lock-fill" v-model="user.password">                 </u--input>  
		</view>
		<view class="login-btn-box">
			<u-button type="primary" color="#f00" @click="login">登录</u-button>
		</view>
		<view class="login-oper-box">
			<view>
				<u-icon name="lock-open"></u-icon>忘记密码
			</view>
			<view>
				<u-icon name="phone"></u-icon>快速注册
			</view>
		</view>
	</view>
</template>

<script>
	import {createNamespacedHelpers} from 'vuex'
	const {mapActions}=createNamespacedHelpers('users')
	export default {
		data() {
			return {
				user:{
					cellphone:'13324537956',
					password:'123456'
				}
			}
		},
		methods: {
			...mapActions(['loginAsync']),
			login(){
				this.loginAsync(this.user)
			}
		}
	}
</script>

<style lang="scss">
	.container {
		width: 750rpx;
		padding: 20rpx;
		box-sizing: border-box;
		.phone-box{
			margin: 10rpx;
		}
		.pwd-box{
			margin: 10rpx;
		}
		.login-btn-box{
			margin: 10rpx;
		}
		.login-oper-box{
			display: flex;
			justify-content: space-between;
			padding: 10rpx;
		}
	}
</style>